<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/scaffold/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{sdSaleOrderStatusBean.id}"/>
		<f:event type="preRenderView" listener="#{sdSaleOrderStatusBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Sd Sale Order Status"/>

	<ui:define name="header">
		Sd Sale Order Status
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty sdSaleOrderStatusBean.id}">
				Edit existing Sd Sale Order Status
			</c:when>
			<c:otherwise>
				Create a new Sd Sale Order Status
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="sdSaleOrderStatusBeanSdSaleOrderStatusSoStatusNo" value="So Status No:"/>
				<h:panelGroup>
					<h:inputText id="sdSaleOrderStatusBeanSdSaleOrderStatusSoStatusNo" required="true" value="#{sdSaleOrderStatusBean.sdSaleOrderStatus.soStatusNo}"/>
					<h:message for="sdSaleOrderStatusBeanSdSaleOrderStatusSoStatusNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="sdSaleOrderStatusBeanSdSaleOrderStatusSoStatusCode" value="So Status Code:"/>
				<h:panelGroup>
					<h:inputText id="sdSaleOrderStatusBeanSdSaleOrderStatusSoStatusCode" maxLength="20" value="#{sdSaleOrderStatusBean.sdSaleOrderStatus.soStatusCode}"/>
					<h:message for="sdSaleOrderStatusBeanSdSaleOrderStatusSoStatusCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sdSaleOrderStatusBeanSdSaleOrderStatusSoStatusDescr" value="So Status Descr:"/>
				<h:panelGroup>
					<h:inputText id="sdSaleOrderStatusBeanSdSaleOrderStatusSoStatusDescr" maxLength="300" value="#{sdSaleOrderStatusBean.sdSaleOrderStatus.soStatusDescr}"/>
					<h:message for="sdSaleOrderStatusBeanSdSaleOrderStatusSoStatusDescr" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sdSaleOrderStatusBeanSdSaleOrderStatusSdSaleOrders" value="Sd Sale Orders:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sdSaleOrderStatusBean.sdSaleOrderStatus.sdSaleOrders}"/>
					<h:dataTable id="sdSaleOrderStatusBeanSdSaleOrderStatusSdSaleOrders" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="So No"/>
							</f:facet>
							<h:link outcome="/sdSaleOrder/view">
								<f:param name="id" value="#{_item.soNo}"/>
								<h:outputText id="itemSoNo" value="#{_item.soNo}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sdSaleOrderBeanAddSoNo" value="#{sdSaleOrderBean.add.soNo}"/>
								<h:message for="sdSaleOrderBeanAddSoNo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Code"/>
							</f:facet>
							<h:link outcome="/sdSaleOrder/view">
								<f:param name="id" value="#{_item.soNo}"/>
								<h:outputText id="itemSoCode" value="#{_item.soCode}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sdSaleOrderBeanAddSoCode" maxLength="50" value="#{sdSaleOrderBean.add.soCode}"/>
								<h:message for="sdSaleOrderBeanAddSoCode" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Descr"/>
							</f:facet>
							<h:link outcome="/sdSaleOrder/view">
								<f:param name="id" value="#{_item.soNo}"/>
								<h:outputText id="itemSoDescr" value="#{_item.soDescr}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sdSaleOrderBeanAddSoDescr" maxLength="100" value="#{sdSaleOrderBean.add.soDescr}"/>
								<h:message for="sdSaleOrderBeanAddSoDescr" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Date"/>
							</f:facet>
							<h:link outcome="/sdSaleOrder/view">
								<f:param name="id" value="#{_item.soNo}"/>
								<h:outputText id="itemSoDate" value="#{_item.soDate}">
									<f:convertDateTime type="date"/>
								</h:outputText>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sdSaleOrderBeanAddSoDate" maxLength="10" value="#{sdSaleOrderBean.add.soDate}">
									<f:convertDateTime type="date"/>
								</h:inputText>
								<h:message for="sdSaleOrderBeanAddSoDate" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Discount Perc"/>
							</f:facet>
							<h:link outcome="/sdSaleOrder/view">
								<f:param name="id" value="#{_item.soNo}"/>
								<h:outputText id="itemSoDiscountPerc" value="#{_item.soDiscountPerc}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sdSaleOrderBeanAddSoDiscountPerc" value="#{sdSaleOrderBean.add.soDiscountPerc}"/>
								<h:message for="sdSaleOrderBeanAddSoDiscountPerc" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(sdSaleOrderBean.added)}" id="sdSaleOrderStatusBeanSdSaleOrderStatusSdSaleOrdersAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{sdSaleOrderBean.add.sdSaleOrderStatus}" value="#{sdSaleOrderStatusBean.sdSaleOrderStatus}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{sdSaleOrderStatusBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty sdSaleOrderStatusBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{sdSaleOrderStatusBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{sdSaleOrderStatusBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>